package com.huashi.dealer.modular.business.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huashi.dealer.commonEntity.GoodsImage;
import com.huashi.dealer.commonEntity.UploadFile;
import com.huashi.dealer.modular.business.goods.vo.GoodsImageWithUrl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * API商品图片Mapper接口
 *
 * @author 谭陈强
 * @since 2025-08-05
 */
@Mapper
@Component("apiGoodsImageMapper")
public interface GoodsImageMapper extends BaseMapper<GoodsImage> {

    /**
     * 根据商品ID查询图片列表
     *
     * @param goodsId 商品ID
     * @return 图片列表
     */
    List<GoodsImage> selectByGoodsId(@Param("goodsId") Long goodsId);

    List<String> getFileUrlByGoodsId(@Param("goodsId") Long goodsId);

    List<UploadFile> getFileByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * 根据商品ID查询图片ID和URL信息
     *
     * @param goodsId 商品ID
     * @return 图片信息列表（包含ID和URL）
     */
    List<GoodsImageWithUrl> getGoodsImageWithUrl(@Param("goodsId") Long goodsId);
}